package STX.entity;

import java.util.ArrayList;
import java.util.List;

public class Course {
    private int id;
    private String className;
    private String place;
    private String time;
    private Teacher teacher;
    private List<Student> students = new ArrayList<>(); // 选课学生列表

    public Course(int id, String className, String place, String time, Teacher teacher) {
        this.id = id;
        this.className = className;
        this.place = place;
        this.time = time;
        this.teacher = teacher;
    }

    public void addStudent(Student student) {
        students.add(student);
    }

    public List<Student> getStudents() {
        return students;
    }

    public String getClassName() { return className; }
    public String getPlace() { return place; }
    public String getTime() { return time; }
    public Teacher getTeacher() { return teacher; }
}
